package com.aj.http.request;

import java.util.HashMap;

import org.json.JSONException;
import org.json.JSONObject;

import com.aj.application.LoveHomeApplication;

public class BaseRequset {

	protected static final String SERVICE_LOGIN_STRING = "aj_user_login";

	protected static final String VERSION_STRING = "1.0";
	protected static final String MODLE_STRING = "11";
	protected static final String CANNELID_STRING = "100";
	protected static final String BASE_REQUEST_URL_NOPAGE_STRING = "http://mymost.gotoip55.com/service/proxy?t="
			+ LoveHomeApplication.token + "&v=" + VERSION_STRING;
	protected static final String BASE_REQUEST_URL_STRING = "http://mymost.gotoip55.com/service/proxy?t="
			+ LoveHomeApplication.token
			+ "&v="
			+ VERSION_STRING
			+ "pageSize=%d&currentPage=%d";

	protected static final String CALLTYPE_STRING = "001";

	protected String getParams(String serviceName,
			HashMap<String, String> params) {
		JSONObject jsonObject = new JSONObject();
		try {
			jsonObject.put("serviceName", serviceName);
			jsonObject.put("callType", CALLTYPE_STRING);
			jsonObject.put("params", new JSONObject(params));
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return jsonObject.toString();
	}
}
